package usi.mn.changelanguage;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class ChangeLanguage extends Activity {
	/** Called when the activity is first created. */
	EditText edit;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		edit = (EditText) this.findViewById(R.id.insertCode);
		Button btnUpdate = (Button) findViewById(R.id.updateButton);
		btnUpdate.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.putExtra("locale", edit.getText().toString());
				intent.setAction("mn.usi.CHANGE_LOCALE");
				ChangeLanguage.this.sendBroadcast(intent);
			}
		});
	}
}